home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS01.ADF
/
ABasicStuff
/
Tools
/
Demo.bas
< prev
next >
Wrap
BASIC Source File
|
1985-12-04
|
19KB
|
494 lines
10 gosub 64000:REM Initialization
20 def fnGetX(x%)=x%
30 def fnGetY(y%)=y%
90 goto 10000
100 Data$="":REM LineRead
110 LRec%=TRec%:LByte%=Bptr%
115 If Bptr%>128 then gosub 200
120 CRPos%=instr(Bptr%,FI$,chr$(10))
130 if CRPos%=0 then Data$=right$(FI$,129%-Bptr%):GOSUB 200
140 Data$=Data$+mid$(FI$,Bptr%,CRPos%-Bptr%)
150 Bptr%=CRPos%+1
160 RETURN
200 REM Split off from buffer
205 RGet #10,Trec%:Trec%=Trec%+1
210 Bptr%=1
215 CRPos%=instr(Bptr%,FI$,chr$(10))
220 RETURN
300 Rem GET A TOKEN
305 token$=""
310 if tptr%>len(data$) then return
315 done%=0
320 while not done%:if mid$(data$,tptr%,1%)=" " then tptr%=tptr%+1:done%=tptr%>len(data$) else done%=-1:wend
330 DC$=mid$(data$,tptr%,1%)
340 if (dc$="'") or (dc$=chr$(34)) then tptr%=tptr%+1 else dc$=" "
350 Delim%=instr(tptr%,data$,dc$)
360 if Delim%=0 then Delim%=len(data$)+1%
370 token$=mid$(data$,tptr%,Delim%-tptr%)
380 tptr%=Delim%
390 if dc$<>" " then tptr%=tptr%+1
395 RETURN
800 REM DoFile
810 linedone%=0
820 while not linedone%:gosub 1000:wend
830 RETURN
1000 REM DoOneLine
1010 GOSUB 100
1020 if data$="" THEN 1090
1030 if mid$(data$,1%,1%)=";" then RETURN
1040 if mid$(data$,1%,1%)<>"%" THEN 1090
1050 tptr%=2%:gosub 300
1060 while token$<>"":cmdno%=instr(CMDSTR$,token$)-1
1065 if cmdno% mod 6<>0 then 1077
1068 if cmdno%=6 then close #4
1070 if cmdno%<12 then linedone%=-1:RETURN
1075 on int(cmdno%/6)-1 gosub 1800,1900,1100,1150,1700,1200,1250,1650,1300,1400,1450,2000,1600,2200
1077 gosub 300
1080 wend
1085 RETURN
1090 gosub 4000
1099 RETURN
1100 REM Handle "r" command
1110 gosub 300:crow%=val(token$):ccol%=1:goto 1160
1150 REM "@" command
1155 gosub 300:ccol%=val(token$):gosub 300:crow%=val(token$)
1160 print at (fnGetX(ccol%),fnGetY(crow%));
1170 RETURN
1200 REM "es"
1205 gosub 1250
1210 svcol%=ccol%:svrow%=crow%
1212 for crow%=svrow%+1 to WInfo%(cw%,3):ccol%=MargInfo%(cw%,crow%-1,0):gosub 1250:next
1220 ccol%=svcol%:crow%=svrow%
1225 gosub 1160
1230 RETURN
1250 REM "el"
1255 if ccol%<0 then 1299
1260 print at (fnGetX(ccol%),fnGetY(crow%));
1265 print spc(MargInfo%(cw%,crow%-1,1)-ccol%+1);
1299 RETURN
1300 REM Set up window
1305 gosub 300:tw%=val(token$)
1310 for i%=0 to 3:gosub 300:WInfo%(tw%,i%)=val(token$):next
1315 gosub 300
1320 rem gosub 300:wcolor%=val(token$):gosub 300:thick%=val(token$)
1335 close #tw%
1340 window #tw%,8*(WInfo%(tw%,0)-1),8*(WInfo%(tw%,1)-1),8*(WInfo%(tw%,2)+2),8*(WInfo%(tw%,3)+2),token$
1370 for ti%=1 to WInfo%(tw%,3):MargInfo%(tw%,ti%-1,0)=1:MargInfo%(tw%,ti%-1,1)=WInfo%(tw%,2):next
1390 gosub 1405
1399 RETURN
1400 REM "usew"
1402 gosub 300:tw%=val(token$)
1404 if tw%<0 or tw%>3 then RETURN
1405 savecol%(cw%)=ccol%:saverow%(cw%)=crow%
1410 cw%=tw%
1415 ccol%=savecol%(cw%):crow%=saverow%(cw%)
1417 cmd #tw%
1420 gosub 1160
1425 RETURN
1450 REM "margin"
1499 RETURN
1600 REM "wrap"
1610 gosub 300: if val(token$)=0 then wrap%=0 else wrap%=-1:RETURN
1650 REM "space"
1655 gosub 300:if val(token$)=1 then spacing%=1:RETURN
1660 if val(token$)=2 then spacing%=2
1665 RETURN
1700 REM "s"
1705 gosub 300:ti%=val(token$):if ti%<0 or ti%>19 then RETURN
1710 gosub 300:svar$(ti%)=token$:snum(ti%)=val(token$)
1720 RETURN
1800 RETURN
1900 gosub 300:ti%=val(token$)
1905 if ti%<0 or ti%>19 then RETURN
1910 FileMark%(ti%,0)=LRec%:FileMark%(ti%,1)=LByte%
1915 RETURN
1950 REM Jump to mark
1965 RETURN
2000 RETURN
2200 REM Draw a frame
2210 RETURN
4000 if instr(data$,"<")>0 then gosub 5000 :REM Fillvars
4005 tmax%=MargInfo%(cw%,crow%-1,1)-ccol%+1
4010 tstart%=1
4015 while len(data$)-tstart%+1>tmax%
4020 tj%=tstart%+tmax%-1
4025 if (not wrap%) or (tj%>len(data$)) or (mid$(data$,tj%,1)=" ") or (mid$(data$,tj%+1,1)=" ") then 4050
4030 while (tj%>=tstart%) and (mid$(data$,tj%,1)<>" "):tj%=tj%-1:wend
4040 if tj%<tstart% then tj%=tstart%+tmax%-1
4050 print mid$(data$,tstart%,tj%-tstart%+1);
4055 gosub 4400
4060 tstart%=tj%+1
4065 while (mid$(data$,tstart%,1)=" "):tstart%=tstart%+1:wend
4070 wend
4100 if tstart%>len(data$) then 4120
4110 print right$(data$,len(data$)-tstart%+1);
4120 if not wrap% then gosub 4400:goto 4300
4200 ccol%=ccol%+len(data$)-tstart%+1
4210 if right$(data$,1)<>" " and ccol%<>MargInfo%(cw%,crow%-1,1) then print " ";:ccol%=ccol%+1 else gosub 4400
4300 RETURN
4400 for ti%=1 to spacing%:crow%=crow%+1
4405 while MargInfo%(cw%,crow%-1,0)<0:crow%=crow%+1:if crow%>WInfo%(cw%,3) then crow%=1
4407 wend:next
4420 ccol%=MargInfo%(cw%,crow%-1,0)
4435 tmax%=MargInfo%(cw%,crow%-1,1)-ccol%+1
4440 gosub 1160
4450 RETURN
4500 if debug%=0 then 4510
4505 getkey x$:if asc(x$)=27 then END
4510 gosub 1160:return
4999 RETURN
5000 REM FillVars
5010 tstart%=instr(data$,"<")
5020 while tstart%<>0
5025 if mid$(data$,tstart%+1,1)="<" then data$=left$(data$,tstart%)+right$(data$,len(data$)-(tstart%+1)):tstart%=tstart%+1:goto 5070
5030 ti%=instr(tstart%,data$,">")
5040 if ti%=0 then RETURN
5050 tj%=val(mid$(data$,tstart%+1,ti%-(tstart%+1)))
5060 if tj%>=0 and tj%<=19 then data$=left$(data$,tstart%-1)+svar$(tj%)+right$(data$,len(data$)-ti%):tstart%=tstart%+len(svar$(tj%)) else tstart%=ti%+1
5070 tstart%=instr(tstart%,data$,"<")
5080 wend
5090 RETURN
5999 RETURN
10000 REM Main program begins here
10005 screen 1,3,0
10010 open "R",#10,"DEMO.TXT",128
10020 field #10,128 as FI$
10025 gosub 200
10030 wrap%=-1
10040 gosub 63000
10042 REM print fre(0):getkey x$
10045 ask rgb 7,holdr%,holdg%,holdb%
10047 ask rgb 0,tr%,tg%,tb%
10049 rgb 7,tr%,tg%,tb%:rgb 3,holdr%,holdg%,holdb%
10050 scnclr
10100 task%=1
10110 get x$:if x$=chr$(27) then rgb 7,holdr%,holdg%,holdb%:END
10115 if x$="" then 10280
10117 svtask%=task%
10120 if (x$<>chr$(155)) and active%(4) then task%=0:gosub 55300:cmd #0:goto 10275
10130 get x$:if x$="" then 10280
10140 if ((x$>="A") and (x$<="D")) and active%(4) then task%=0:x$=chr$(asc(x$)+128):gosub 55300:cmd #0:goto 10275
10150 if (x$<"0") or (x$>"3") then 10280
10200 task%=val(x$)+1
10210 get x$:REM get rid of "~"
10260 if active%(task%) then close #task%:active%(task%)=0:goto 10110
10270 stage%(task%)=0:active%(task%)=-1
10275 task%=svtask%
10280 gosub 60000
10290 goto 10110
19999 END
20000 REM plot alpha$(sb%,si%) BIG
20020 for sl%=1 to len(alpha$(sb%,si%))
20030 sshape (sl%*12+12,si%*yo%;sl%*12+24,si%*yo%+12),img1%()
20040 soffset%=6:color%=si%+1
20050 v%=vcset%+4+(asc(mid$(alpha$(sb%,si%),sl%,1))-32)*24
20060 while color%<>0
20070 if (color% mod 2)=1 then for sk%=0 to 23 step 4:poke_l vimg1%+soffset%+sk%,peek_l(v%+sk%):next
20080 color%=int(color%/2)
20090 soffset%=soffset%+24
20100 wend
20110 gshape (sl%*12+12,si%*yo%),img1%()
20120 next
20190 RETURN
20300 v%=vcset%+4+24*(asc(sc$)-32)
20310 for sk%=0 to 23 step 4:poke_l vone%+6+sk%,peek_l(v%+sk%):next
20320 RETURN
30000 scnclr:ask window wx%,wy%:pena 1:draw (2,0 to 2,wy%-1 to wx%,wy%-1 to wx%,wy%-2 to 3,wy%-2 to 3,0):RETURN
30100 gi%=0:stage%(task%)=stage%(task%)+1:RETURN
41000 if stage%(task%)<>0 then 41100
41010 data$=windata$(task%)
41020 gosub 1020
41030 stage%(task%)=1
41100 cmd #task%
41105 on stage%(task%) goto 41110,41200,41300,41400,41500,41600,41700,41800,41900,42000
41110 scnclr:for i%=0 to 4:j%=rnd*4:x$=alpha$(sb%,j%):alpha$(sb%,j%)=alpha$(sb%,i%):alpha$(sb%,i%)=x$:next
41120 for i%=0 to 4:print " ";alpha$(sb%,i%):next
41130 si%=0:stage%(task%)=2
41200 print at (1,si%+1);">";
41210 sj%=si%+1
41220 stage%(task%)=3:RETURN
41300 print at (1,sj%+1);"?";
41310 if alpha$(sb%,si%)>alpha$(sb%,sj%) then stage%(task%)=4 else stage%(task%)=8
41320 RETURN
41400 print at (3,si%+1);spc(6);
41410 stage%(task%)=5:RETURN
41500 print at (3,si%+1);alpha$(sb%,sj%);
41510 stage%(task%)=6:RETURN
41600 print at (3,sj%+1);spc(6);
41610 stage%(task%)=7:RETURN
41700 print at (3,sj%+1);alpha$(sb%,si%);
41710 x$=alpha$(sb%,si%):alpha$(sb%,si%)=alpha$(sb%,sj%):alpha$(sb%,sj%)=x$
41720 stage%(task%)=8:RETURN
41800 print at (1,sj%+1);" ";
41810 sj%=sj%+1:if sj%<=4 then stage%(task%)=3 else stage%(task%)=9
41820 RETURN
41900 print at (1,si%+1);" ";
41910 si%=si%+1:if si%<4 then stage%(task%)=2 else stage%(task%)=10
41920 sc%=0
41930 RETURN
42000 if sc%<10 then sc%=sc%+1:RETURN
42010 scnclr:print "DONE!!!"
42020 sb%=(sb%+1) mod 3
42030 stage%(task%)=1:RETURN
52000 if stage%(task%)<>0 then 52050
52010 data$=windata$(task%)
52020 gosub 1020
52030 stage%(task%)=1
52040 substage%=0
52050 cmd #task%
52060 on stage%(task%) goto 52100,52150,52200,52300,52400,52500,52600,52700,52800,52900
52100 if substage%>0 then 52120
52105 scnclr:for i%=0 to 4:j%=rnd*4:x$=alpha$(sb%,j%):alpha$(sb%,j%)=alpha$(sb%,i%):alpha$(sb%,i%)=x$:next
52110 substage%=1:si%=0:RETURN
52120 if si%<5 then gosub 20000:si%=si%+1:RETURN
52140 si%=0:stage%(task%)=2:RETURN
52150 REM Put up >, set sj%
52155 sc$=">":gosub 20300:gshape (0,yo%*si%),one%()
52160 sj%=si%+1
52170 stage%(task%)=3:RETURN
52200 REM Put up "?", do compare
52205 sc$="?":gosub 20300:gshape (0,yo%*sj%),one%()
52210 if alpha$(sb%,si%)>alpha$(sb%,sj%) then stage%(task%)=4 else stage%(task%)=8
52220 RETURN
52300 REM Erase comparand
52310 sshape (12,yo%*si%;96,yo%*si%+12),img1%()
52315 pena 0: peno 0: box(12,yo%*si%;96,yo%*si%+12),1
52320 stage%(task%)=5:RETURN
52400 REM print comparand at top
52410 sshape (12,yo%*sj%;96,yo%*sj%+12),img2%()
52415 gshape (12,yo%*si%),img2%()
52420 stage%(task%)=6:RETURN
52500 REM Erase comparand
52510 pena 0:peno 0:box (12,yo%*sj%;96,yo%*sj%+12),1
52520 stage%(task%)=7:RETURN
52600 REM Print head at comparand, do real swap
52610 gshape (12,yo%*sj%),img1%()
52620 x$=alpha$(sb%,si%):alpha$(sb%,si%)=alpha$(sb%,sj%):alpha$(sb%,sj%)=x$
52630 stage%(task%)=8:RETURN
52700 REM erase "?"; increment sj% and test
52710 sc$=" ":gosub 20300:gshape (0,yo%*sj%),one%()
52720 sj%=sj%+1:if sj%<=4 then stage%(task%)=3 else stage%(task%)=9
52730 RETURN
52800 REM erase ">"; increment si% and test
52810 sc$=" ":gosub 20300:gshape (0,yo%*si%),one%()
52820 si%=si%+1:if si%<4 then stage%(task%)=2 else stage%(task%)=10
52830 sc%=0: REM subcount
52840 RETURN
52900 REM Done sorting
52910 REM if sc%=0 then graphic(1):print at (0,84);" DONE!";:graphic(0)
52920 if sc%<10 then sc%=sc%+1:RETURN
52930 scnclr:sb%=(sb%+1) mod 3
52940 stage%(task%)=1:substage%=0:RETURN
53000 if stage%(task%)<>0 then 53050
53010 data$=windata$(task%)
53020 gosub 1020
53030 stage%(task%)=1:RETURN
53040 gi%=-5
53050 cmd #task%
53060 on stage%(task%) goto 53100,53110,53180,53200,53250,53300,53400,53420,53450,53460,53500,53520,53550
53100 gosub 30000:gx%=-35:gosub 30100:RETURN
53110 ask window wx%,wy%
53120 gx%=gx%+40:if gx%>wx% then gosub 30100:RETURN
53130 gj%=rnd(1)*(wy%-3)
53140 if 2*rnd(1)<1 then pattern 8,pat1%() else pattern 8,pat2%()
53150 gk%=rnd(1)*5+1:pena gk%:peno gk%
53155 penb int(rnd(1)*8)
53160 box (gx%,gj%;gx%+30,wy%-3),1
53165 penb 0
53170 RETURN
53180 if gi%>10 then gosub 30100 else gi%=gi%+1
53190 RETURN
53200 scnclr:ask window gx%,gy%:grad%=gx%:if gy%<grad% then grad%=gy%
53205 gx%=gx%/2:gy%=gy%/2:grad%=(grad%-4)/2:pena 1:peno 1
53210 draw (gx%,gy% to gx%+2*grad%,gy%):for gj%=0 to 36:draw (to gx%+grad%*ctabl(gj%),gy%-grad%*stabl(gj%)):next
53220 gi%=0:angle(0)=0:angle(4)=36:stage%(task%)=5:RETURN
53250 if gi%=3 then gosub 30100: RETURN else gi%=gi%+1
53260 gj%=rnd(1)*11:if gj%<2 then gj%=gj%+2
53265 angle(gi%)=angle(gi%-1)+gj%
53270 pena 1:draw (gx%,gy% to gx%+grad%*ctabl(angle(gi%)),gy%-grad%*stabl(angle(gi%)))
53275 gpen%=rnd(1)*5+1
53280 RETURN
53300 if gi%=4 then gosub 30100:RETURN else gi%=gi%+1
53310 gpen%=((gpen%+1) mod 7)+1:pena gpen%:penb int(rnd(1)*8):peno 1
53315 af%(0)=gx%:af%(1)=gy%:gl%=2
53320 for gk%=angle(gi%-1) to angle(gi%)
53330 af%(gl%)=gx%+grad%*ctabl(gk%):af%(gl%+1)=gy%-grad%*stabl(gk%)
53340 gl%=gl%+2:next
53345 if 2*rnd(1)<1 then pattern 8,pat1%() else pattern 8,pat2%()
53350 mat area gl%/2,af%()
53360 penb 0
53370 RETURN
53400 if gi%>7 then gosub 30100 else gi%=gi%+1
53410 RETURN
53420 gosub 30000:gosub 30100:gstage%=stage%(task%):ggraf%=0:gpen%=(rnd(1)*5)+1:wy%=wy%-2:RETURN
53450 af%(0)=4:af%(1)=wy%:af%(2)=4:af%(3)=rnd(1)*(wy%*0.8):gx%=24:gl%=4
53460 while gx%<wx%:af%(gl%)=gx%:af%(gl%+1)=rnd(1)*(wy%*(.75-.2*(1-ggraf%)))+.2*ggraf%*wy%
53470 pena 1:draw (af%(gl%-2),af%(gl%-1) to af%(gl%),af%(gl%+1))
53480 gl%=gl%+2:gx%=gx%+20:wend
53490 af%(gl%)=wx%:af%(gl%+1)=rnd(1)*wy%
53495 af%(gl%+2)=wx%:af%(gl%+3)=wy%:gl%=gl%+4:gosub 30100:RETURN
53500 gpen%=((gpen%+1) mod 6)+1:pena gpen%:penb (rnd(1)*7):if rnd(1)*2>1 then pattern 8,pat1%() else pattern 8,pat2%()
53510 mat area gl%/2,af%():penb 0:gosub 30100
53520 if gi%<7 then gi%=gi%+1:RETURN
53530 ggraf%=ggraf%+1:if ggraf%=2 then gosub 30100 else stage%(task%)=gstage%
53540 RETURN
53550 if gi%>10 then gi%=0:stage%(task%)=1 else gi%=gi%+1
53560 RETURN
54000 if stage%(task%)=1 then 54100
54010 data$=windata$(task%)
54020 gosub 1020
54030 stage%(task%)=1
54100 cmd #task%
54110 print froth$(frct%)
54120 frct%=(frct%+1) mod 14
54130 RETURN
55000 if stage%(task%)<>0 then cmd #task%:goto 55100
55010 data$=windata$(task%)
55020 gosub 1020
55025 wline%=WInfo%(task%,3):wmaxcol%=WInfo%(task%,2)-2:wdim%=20
55030 stage%(task%)=1
55040 cmd #task%
55050 for wi%=1 to wline%:print wtext$(wi%);:if wi%<>wline% then print
55055 next
55060 wrr%=1:wpr%=1:wpc%=1
55065 cmd #0
55070 RETURN
55100 wcurs%=(-wcurs%)-1
55120 gosub 55150
55130 get x$:if x$<>"" then gosub 55300
55140 RETURN
55150 pena abs(wcurs%):draw (8*(wpc%-1),8*(wpr%-1) to 8*(wpc%-1),8*wpr%):RETURN
55300 cmd #4:wcurs%=0:gosub 55150:cmd #task%
55310 if x$=chr$(27) then RETURN
55315 if (x$>=chr$(192)) and (x$<=chr$(196)) then x$=chr$(asc(x$)-128):goto 55325
55320 if x$<>chr$(155) then 55330
55322 get x$
55325 cmd #4:if x$<>"" then wi%=asc(x$)-asc("@"):on wi% goto 55400,55420,55440,55460
55330 cmd #4:if x$=chr$(127) or x$=chr$(8) then goto 55900
55340 if x$=chr$(13) then 55500
55350 if x$>=" " then 55600
55370 RETURN
55400 if wrr%=1 then RETURN else wrr%=wrr%-1:wpr%=wpr%-1
55405 if wpr%<1 then print chr$(27);"[1T";at (1,1);wtext$(wrr%);:wpr%=1
55410 if wpc%>len(wtext$(wrr%)) then wpc%=len(wtext$(wrr%))+1
55415 RETURN
55420 if wrr%=wdim% then RETURN else wrr%=wrr%+1:wpr%=wpr%+1
55425 if wpr%<=wline% then 55410
55430 print chr$(27);"[1S";at (1,wline%);wtext$(wrr%);:wpr%=wline%
55435 goto 55410
55440 if wpc%<=len(wtext$(wrr%)) then wpc%=wpc%+1 else wpc%=1:goto 55420
55445 RETURN
55460 if wpc%>1 then wpc%=wpc%-1 else if wrr%>1 then wpc%=99:goto 55400
55465 RETURN
55500 wi%=wrr%:wtemp$=wtext$(wi%)
55505 wword$=mid$(wtemp$,wpc%):wtemp$=left$(wtemp$,wpc%-1)+chr$(171)
55510 print at (1,wpr%);wtemp$;chr$(27);"[1K":wtext$(wi%)=wtemp$
55520 while left$(wword$,1)=" ":wword$=mid$(wword$,2):wend
55530 if wi%=wdim% then RETURN
55540 gosub 55420:wpc%=1:x$=""
55545 wtext$(wrr%)=wword$+" "+wtext$(wrr%):goto 55600
55550 RETURN
55600 wtemp$=wtext$(wrr%)
55605 wtemp$=left$(wtemp$,wpc%-1)+x$+right$(wtemp$,len(wtemp$)-wpc%+1):wtext$(wrr%)=wtemp$
55610 if len(wtemp$)<=wmaxcol% then print at (1,wpr%);wtemp$;:gosub 55440:RETURN
55615 wi%=wrr%:worig%=wpc%
55620 wj%=wmaxcol%:while (wj%>1) and (mid$(wtemp$,wj%,1)<>" "):wj%=wj%-1:wend
55630 wword$=right$(wtemp$,len(wtemp$)-wj%)
55635 wtemp$=left$(wtemp$,wj%-1)
55640 wtext$(wi%)=wtemp$
55650 wl%=wpr%+(wi%-wrr%):if wl%<=wline% then print at (1,wl%);wtemp$;chr$(27);"[1K";
55660 if wi%=wdim% then gosub 55440:RETURN
55670 if right$(wword$,1)=chr$(171) then 55800
55675 wi%=wi%+1:wtemp$=wword$+" "+wtext$(wi%)
55680 wtext$(wi%)=wtemp$:wl%=wpr%+(wi%-wrr%)
55685 if len(wtemp$)>=wmaxcol% then 55620
55690 if wl%<=wline% then print at(1,wl%);wtemp$;
55700 wi%=wrr%:if x$<>"" then gosub 55440
55710 if wi%<>wrr% then wpc%=worig%-len(wtext$(wi%))
55750 RETURN
55800 for wj%=wdim%-1 to wi%+1 step -1: wtext$(wj%+1)=wtext$(wj%):next
55810 wi%=wi%+1:wtext$(wi%)=wword$
55820 for wj%=wpr% to wline%:print at (1,wj%);wtext$(wrr%+(wj%-wpr%));chr$(27);"[1K";:next
55840 goto 55700
55900 REM Handle DELETE
55905 gosub 55460
55907 wi%=wrr%
55910 wtemp$=wtext$(wi%)
55915 wtemp$=left$(wtemp$,wpc%-1)+right$(wtemp$,len(wtemp$)-wpc%)
55920 wtext$(wi%)=wtemp$
55925 if right$(wtemp$,1)=chr$(171) then gosub 56100:RETURN
55930 if wtemp$="" then gosub 56200:RETURN
55940 if wi%=wdim% then gosub 56100:RETURN
55945 wj%=wmaxcol%-len(wtemp$)
55950 if wj%>len(wtext$(wi%+1)) then wj%=len(wtext$(wi%+1))+1:goto 55970
55955 while (wj%>0) and mid$(wtext$(wi%+1),wj%,1)<>" ":wj%=wj%-1:wend
55960 if wj%=0 then gosub 56100:RETURN
55970 wtemp$=wtemp$+" "+left$(wtext$(wi%+1),wj%-1)
55975 gosub 56100
55980 wtext$(wi%)=wtemp$:wi%=wi%+1
55990 wtemp$=wtext$(wi%):wtemp$=right$(wtemp$,len(wtemp$)-wj%)
55995 goto 55920
56000 wtemp$=right$(wtemp$,len(wtemp$)-wj%)
56010 gosub 56100
56020 goto 55920
56100 if wpr%+wi%-wrr%<=wline% then print at (1,wpr%+wi%-wrr%);wtemp$;chr$(27);"[1K";
56110 RETURN
56200 for wj%=wi% to wdim%-1:wtext$(wj%)=wtext$(wj%+1):wl%=wj%-(wrr%-wpr%):if wl%<=wline% then print at (1,wl%);wtext$(wj%);chr$(27);"[1K";
56210 next: wtext$(wdim%)=""
56220 RETURN
60000 REM Task dispatcher
60010 tick%=tick%+1
60020 if tick%<tickmod% then RETURN
60030 tick%=0
60040 if active%(task%) then on task% gosub 54000,52000,53000,55000
60045 cmd #0
60050 task%=(task% mod maxtask%)+1
60060 RETURN
61999 END
63000 dim alpha$(2,4),active%(4),stage%(4)
63010 dim angle(4),af%(72),ctabl(36),stabl(36)
63015 dim pat1%(7),pat2%(7)
63020 dim froth$(14),windata$(4),wtext$(20)
63030 dim cset%(580),img1%(112),img2%(112),one%(20)
63040 maxtask%=4:yo%=14
63050 for i%=0 to 2:for j%=0 to 4:gosub 100:alpha$(i%,j%)=data$:next:next
63060 for i%=1 to maxtask%:gosub 100:windata$(i%)=data$:next
63070 i%=0:gosub 100
63080 while data$<>"---"
63090 if i%<15 then froth$(i%)=data$:i%=i%+1:gosub 100
63100 wend
63110 tickmod%=1
63120 i%=1:gosub 100
63130 while data$<>"---"
63140 if right$(data$,1)="*" then replace$(data$,len(data$),1)=chr$(171)
63150 if i%<=15 then wtext$(i%)=data$:i%=i%+1:gosub 100
63160 wend
63170 vcset%=varptr(cset%(0))
63180 vimg1%=varptr(img1%(0))
63190 vimg2%=varptr(img2%(0))
63200 vone%=varptr(one%(0)):poke vone%+1,1:poke vone%+3,12:poke vone%+5,12
63210 bload "twelvefont",vcset%
63220 for i%=0 to 36:stabl(i%)=sin(pi*10*i%/180):ctabl(i%)=2*cos(pi*10*i%/180):next
63230 for i%=0 to 7:read pat1%(i%):next:for i%=0 to 7:pat2%(i%)=65535:next
63500 RETURN
63510 data 61440,15360,3840,960,240,60,15,49155
64000 DIM MargInfo%(4,23,1),FileMark%(19,1),WInfo%(4,3)
64010 DIM SVar$(19),SNum(20),savecol%(4),saverow%(4)
64020 TRec%=1%:Bptr%=1%:LRec%=1%:LByte%=1%
64030 for i%=0 to 4
64040 for j%=0 to 23
64050 MargInfo%(i%,j%,0)=1
64060 MargInfo%(i%,j%,1)=37
64070 next:next
64080 for i%=0 to 4
64090 WInfo%(i%,0)=1:WInfo%(i%,1)=1
64100 WInfo%(i%,2)=37:WInfo%(i%,3)=23
64110 next
64120 cw%=0
64130 CMDSTR$="w end p m r @ s es el space windowusew margindo wrap "
64135 CMDSTR$=CMDSTR$+"frame "
64140 wrap%=0:spacing%=1
64150 for i%=0 to 3:savecol%(i%)=1:saverow%(i%)=1:next
64160 RETURN
64170 end